package excercisefour;
import excercisefour.*;
public class Text {
    public static double TaxStandards(double money) { 
        double TaxReceivable = 0;
        try {
            if (0 <= money && money <= 5000) {
                TaxReceivable = 0;
            }
            if (5000 < money && money <= 8000) {
                TaxReceivable = money * 0.03;
            }
            if (8000 < money && money <= 17000) {
                TaxReceivable = money * 0.10;
            }
            if (17000 < money && money <= 30000) {
                TaxReceivable = money * 0.20;
            }
            if (30000 < money && money <= 40000) {
                TaxReceivable = money * 0.25;
            }
            if (TaxReceivable < 0) {
                System.out.println("收入金额有误！");
            }
        } catch (Exception e) {
            System.out.println("收入金额有误！");
        }
        final double TaxReceivable1 = TaxReceivable;
        return TaxReceivable1;
    }

    public static void SplitLine() {
        for (int i = 1; i < 45; i++) {
            System.out.print("——");
        }
        System.out.println();
    }

    public static void main(String[] args) { 
        String _18weekScoringList1[] = { "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优", "优",
                "优", "优" };
        String _18weekScoringList2[] = { "及格", "及格", "及格", "及格", "及格", "及格", "优", "及格", "及格", "及格", "及格", "及格", "及格",
                "及格", "及格", "及格", "及格", "及格" };
        String _18weekScoringList3[] = { "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格", "不及格",
                "不及格", "不及格", "不及格", "不及格", "不及格" };
        String _18weekScoringList4[] = { "及格", "及格", "优", "及格", "及格", "优", "及格", "及格", "优", "及格", "及格", "及格", "及格",
                "及格", "优", "及格", "及格", "及格" };
        String _18weekScoringList5[] = { "及格", "优", "不及格", "及格", "及格", "及格", "优", "及格", "及格", "及格", "及格", "及格", "及格",
                "及格", "及格", "及格", "及格", "不及格" };

        Lab ComputerNetworkLaboratory = new Lab(1, "1.1实验室", _18weekScoringList1);
        Lab CompositionPrincipleLaboratory = new Lab(2, "1.2实验室", _18weekScoringList2);
        Lab PhysicsLaboratory = new Lab(3, "2.1实验室", _18weekScoringList3);
        Lab ChemicalLaboratory = new Lab(4, "2.2实验室", _18weekScoringList4);
        Lab BiologyLaboratory = new Lab(5, "2.3实验室", _18weekScoringList5);

        Lab moren1[] = new Lab[5];
        Lab moren2[] = new Lab[5];
        Students yi = new Students(1, "111", moren1, 0);
        Students two = new Students(2, "222", moren2, 0);

        yi.setlaboratory(0, moren1, ComputerNetworkLaboratory); // 分配实验室
        yi.setlaboratory(1, moren1, CompositionPrincipleLaboratory);
        two.setlaboratory(0, moren2, PhysicsLaboratory);
        two.setlaboratory(1, moren2, ChemicalLaboratory);
        two.setlaboratory(2, moren2, BiologyLaboratory);

        yi.WorkStudyIncome(ComputerNetworkLaboratory.getCleanlinessScore(), yi); // 为实验室评分
        yi.WorkStudyIncome(CompositionPrincipleLaboratory.getCleanlinessScore(), yi);
        two.WorkStudyIncome(PhysicsLaboratory.getCleanlinessScore(), two);
        two.WorkStudyIncome(ChemicalLaboratory.getCleanlinessScore(), two);
        two.WorkStudyIncome(BiologyLaboratory.getCleanlinessScore(), two);
        SplitLine();
        SplitLine();
        System.out.println("欢迎使用学生实验室勤工俭学模拟系统！");
        SplitLine();
        SplitLine();
        System.out.println("111同学 负责丨" + yi.getlaboratory()[0].getLaboratoryName() + "丨以及丨"
                + yi.getlaboratory()[1].getLaboratoryName() + "丨");
        SplitLine();
        System.out.println("丨" + yi.getlaboratory()[0].getLaboratoryName() + "丨18周成绩如下:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(yi.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("丨" + yi.getlaboratory()[1].getLaboratoryName() + "丨18周成绩如下:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(yi.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("其纳税前收入为" + yi.getmoneyEarned() + "元。"); // 税收前收入
        SplitLine();
        yi.setmoney(TaxStandards(yi.getmoneyEarned())); // 计算个人所得税
        System.out.println("其税收后收入为" + yi.getmoneyEarned() + "元。"); // 税收后收入
        SplitLine();
        SplitLine();
        System.out.println("222同学 负责丨" + two.getlaboratory()[0].getLaboratoryName() + "丨、丨"
                + two.getlaboratory()[1].getLaboratoryName() + "丨以及丨" + two.getlaboratory()[2].getLaboratoryName()
                + "丨");
        SplitLine();
        System.out.println("丨" + two.getlaboratory()[0].getLaboratoryName() + "丨18周成绩如下:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(two.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("丨" + two.getlaboratory()[1].getLaboratoryName() + "丨18周成绩如下:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(two.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("丨" + two.getlaboratory()[2].getLaboratoryName() + "丨18周成绩如下:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(two.getlaboratory()[2].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("其纳税前收入为" + two.getmoneyEarned() + "元。");
        SplitLine();
        two.setmoney(TaxStandards(two.getmoneyEarned()));
        System.out.println("其税收后收入为" + two.getmoneyEarned() + "元。");
        SplitLine();
        SplitLine();
    }
}
